from zoukao3.Page.Page import Page
from selenium.webdriver.common.by import By
class Page1(Page):
    # 断言登录成功后的用户名
    dy2_loc=(By.XPATH,'//*[@id="user"]/span[2]')
    # 输入框输入内容：北京时间
    sreach_loc=(By.ID,'kw')
    # 点击搜索
    sreachbtn_loc=(By.XPATH,'//*[@id="su"]')
    #滑到底部，点击第三页
    three_loc=(By.XPATH,'//*[@id="page"]/div/strong/span')

    def dy2(self):
        self.text(self.dy2_loc)

    def sreach(self):
        self.send_keys(self.sreach_loc,'北京时间')

    def sreachbtn(self):
        self.click(self.sreachbtn_loc)

    def three(self):
        self.click(self.three_loc)

    def baidu_luoji_02(self):
        self.baidu_luoji_01()
        # print(self.dy2())
        # assert 'ZangXuRui' in self.dy2()
        self.sreach()
        self.sreachbtn()
        self.scrollTo()
        self.three()
